package com.yanqu.road.server.manger.activity.guagifts.service;

import com.google.protobuf.InvalidProtocolBufferException;
import com.yanqu.road.pb.activity.GuaGiftsProto;
import com.yanqu.road.pb.activity.QixiProto;
import com.yanqu.road.pb.syncMessage.SyncMessage;
import com.yanqu.road.server.game.service.IGameServiceCommand;
import com.yanqu.road.server.manger.activity.guagifts.GuaGiftsMgr;
import com.yanqu.road.server.manger.activity.qixi.QixiMgr;
import com.yanqu.road.sync.message.SyncResponse;

public class GuaSearchUserServiceCmd implements IGameServiceCommand {
    @Override
    public SyncResponse execute(SyncMessage.Request request) throws InvalidProtocolBufferException {
        SyncResponse syncResponse = new SyncResponse();
        GuaGiftsProto.GuaGiftsSearchUserReqMsg reqMsg = GuaGiftsProto.GuaGiftsSearchUserReqMsg.parseFrom(request.getDataBytes());

        GuaGiftsProto.GuaGiftsSearchUserRespMsg.Builder resp = GuaGiftsMgr.searchUser(reqMsg.getTargetAliasId(), reqMsg.getGiftType());
        syncResponse.setResponseBuilder(resp);
        return syncResponse;
    }
}
